extends Node2D
@onready var end = $End
@export var level_index : int = 0
@onready var character = $Character
@onready var gameover_screen = $GameoverScreen
@onready var loading = $Loading

signal ended
signal gameover
signal restart_button_pressed
func _ready():
	loading.show_loading_end()
	end.ended.connect(
		func() -> void:
			await exit()
			ended.emit()
	)
	
	character.gameover.connect(
		func() -> void:
			gameover.emit()
	)
	gameover_screen.restart_button_pressed.connect(
		func() -> void:
			gameover_screen.hide()
			loading.position=GR.screen_position
			loading.show_loading()
			await get_tree().create_timer(1).timeout#等待转场动画播放
			restart_button_pressed.emit()
	)
func enter():
	pass
func exit():
	pass
		
		


